<template>
    <div class="duihua">
        <div class="toubu">
            <div class="icon" @click="to">
                <img src="@/assets/images/fanhui.png" alt="">
            </div>
            <div class="al">
                <div class="xiaoji"><img src="@/assets/images/zn.png" alt=""></div>
                <div class="zi">AI小助理</div>
            </div>
        </div>

        <div class="kuang" ref="scrollDiv">
            <div class="right" :class="{'show':ani[0]}">
                <div class="hua">请给我一份关于【张亮麻辣烫】的育商营销提备份 </div>
                <div class="tu">
                    <img src="@/assets/images/juese2.jpg" alt="">
                </div>
            </div>
            <div class="left" :class="{'show':ani[1]}">
                <div class="tu">
                    <img src="@/assets/images/zn.png" alt="">
                </div>
                <div class="hua">
                    <div class="title">
                        嗯噢哇小助理
                    </div>
                    <div class="content">
                        <div class="jizai">
                            正在为你生成关于【张亮麻辣烫】的育商营销
                        </div>
                        <div class="qingkuang">
                            <div class="tou">
                                依据以下数据：
                            </div>
                            <div class="wenzi">
                                商区内营销活动的业态配比分析，跟张亮麻辣
                            </div>
                            <div class="ksh">
                                <img src="@/assets/images/yxhd.png" alt="">
                            </div>
                        </div>
                        <div class="fangan">
                            <div class="faT">
                                有三个方案供你选择，也可以输入更多提案
                            </div>
                            <div class="fangan1">
                                <el-row :gutter="20">
                                    <el-col :span="8" v-for="item in 3" :key="item">
                                        <img :src="require(`@/assets/images/fa${item}.png`)" alt="">
                                    </el-col>
                                </el-row>
                            </div>
                        </div>

                    </div>

                </div>
            </div>

            <div class="right" :class="{'show':ani[2]}">
                <div class="hua">请给我一份关于【张亮麻辣烫】的育商提质提 </div>
                <div class="tu">
                    <img src="@/assets/images/juese2.jpg" alt="">
                </div>
            </div>


            <div class="left" :class="{'show':ani[3]}">
                <div class="tu">
                    <img src="@/assets/images/zn.png" alt="">
                </div>
                <div class="hua">
                    <div class="title">
                        嗯噢哇小助理
                    </div>
                    <div class="content">
                        <div class="jizai">
                            正在为你生成关于[张亮麻辣烫]的育商营销提案..
                        </div>
                        <div class="qingkuang">
                            <div class="tou">
                                依据以下数据：
                            </div>
                            <div class="wenzi">
                                2023年，海口食药监执法人员发现张亮麻辣烫加盟店售卖的“羊肉卷”为“复合肉卷”，鸭肉含量达60%。复合肉卷是将羊肉片卷在塑料片上压制而成，虽然不违反食品安全法，但涉嫌低质卖高价。最后该店被罚款2万元，所售卖的复合肉卷也被依法下架。但对张亮麻辣烫品牌有极大影响，该品牌全国连锁销量同比下家40%
                            </div>
                        </div>
                        <div class="fangan">
                            <div class="faT">
                                有两个方案供你选择，也可以输入更多提案，系统将自动生成更多提案选择
                            </div>
                            <div class="fangan1">
                                <el-row :gutter="20">
                                    <el-col :span="12">
                                        <div class="fa" @click="faClick(1)" :class="faIndex == 1 ? '' : ''">
                                            <div class="ti">提案1</div>
                                            <div class="con">操作间直播，提高加工过程透明化</div>
                                        </div>
                                    </el-col>
                                    <el-col :span="12">
                                        <div class="fa" @click="faClick(2)" :class="faIndex == 2 ? '' : ''">
                                            <div class="ti">提案2</div>
                                            <div class="con">食材一码溯源，表单化呈现，让用户吃得放心 </div>
                                        </div>
                                    </el-col>
                                </el-row>
                            </div>
                        </div>

                    </div>

                </div>
            </div>
            <div class="right" :class="{'show':ani[4]}">
                <div class="hua">提案1，执行</div>
                <div class="tu">
                    <img src="@/assets/images/juese2.jpg" alt="">
                </div>
            </div>
            <div class="left" :class="{'show':ani[5]}">
                <div class="tu">
                    <img src="@/assets/images/zn.png" alt="">
                </div>
                <div class="hua">
                    <div class="title">
                        嗯噢哇小助理
                    </div>
                    <div class="content">
                        <div class="jizai">
                            好的，已按照提案1进行提交，智能助理会跟进事件全流程关键节点，并在最终提交复盘分析报告
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="shuru">
            <el-input v-model="input" placeholder="请输入你的需求"></el-input>
            <div class="tijiao">
                <img src="@/assets/images/fasong.png" alt="">
            </div>
        </div>


    </div>
</template>

<script>
export default {
    data() {
        return {
            input: '',
            faIndex: '1',
            ani:[false,false,false,false,false],
            timer:null
        }
    },
    mounted() {
        var that = this;
        var an = -1
        this.timer =  setInterval(() => {
            if(an == 6){
                that.timer = null
                clearInterval(that.timer)
                return
            }
            an++;
            that.ani[an] = true
            that.handleScrollBottom()
            that.$forceUpdate()
        }, 1000);
    },
    destroyed(){
        var that = this;
        that.timer = null
        clearInterval(that.timer)
    },
    methods: {
        // 滚动到底部
        handleScrollBottom() {
            this.$nextTick(() => {
                let scrollElem = this.$refs.scrollDiv;
                scrollElem.scrollTo({ top: scrollElem .scrollHeight, behavior: 'smooth' });
            });
        },
            name() {

        },
        to() {
            this.$router.go(-1)
            // this.$router.push({
            //     path: '/govIndexData/juese2',
            //     query: {
            //         type:'1'
            //     },
            // })
        },
        faClick(num) {
            this.faIndex = num

            this.$router.push({
                path: '/govIndexData2/juese2',
            })
            window.localStorage.setItem("status","1");
            // console.log(this.faIndex, 'this.faIndex');
        },
    },
}
</script>

<style lang="scss" scoped>
.duihua {

    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;

    .toubu {
        box-sizing: border-box;
        padding: 0 18px;
        display: flex;
        align-items: center;
        height: 88px;
        background: #FFFFFF;
        border-radius: 12px;
        box-shadow: 0px 1px 4px 0px rgba(13, 46, 166, 0.02), 0px 2px 12px 0px rgba(13, 46, 166, 0.04), 0px 2px 6px 0px rgba(13, 46, 166, 0.02);
    }

    .al {
        margin-left: 15px;
        display: flex;
        align-items: center;
        font-size: 20px;
        font-weight: 500;
        color: rgba(0, 0, 0, 0.9);
    }

    .icon {
        cursor: pointer;
        width: 22px;
        height: 22px;
    }

    .xiaoji {
        width: 33px;
        height: 33px;
    }

    img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .shuru {
        display: flex;
        justify-content: space-between;
        align-items: center;
        height: 64px;
        background: #FFFFFF;
        box-shadow: 0px 1px 4px 0px rgba(13, 46, 166, 0.02), 0px 2px 12px 0px rgba(13, 46, 166, 0.04), 0px 2px 6px 0px rgba(13, 46, 166, 0.02);
        border-radius: 8px;
        box-sizing: border-box;
        padding: 0 16px 0 0;

        /deep/ {
            .el-input__inner {
                border: none !important;
            }
        }

        .el-input {
            width: 90%;
        }

        .tijiao {
            width: 19px;
            height: 20px;
        }


    }

    .kuang {
        height: calc(100% - 200px);
        padding: 50px 0;
        overflow-y: auto;
        margin: 20px 0;
        &>div{
            transition: all 0.4s;
            opacity: 0;
            visibility: hidden;
            height: 0;
            overflow: hidden;
            &.show{
                visibility: visible;
                opacity: 1;
                height: auto;
            }
        }
        // border: 1px solid red;

        .tu {
            width: 48px;
            height: 46px;
            border-radius: 50%;
            overflow: hidden;
            margin: 0 12px;

            img {
                width: 100%;
                height: 100%;
                object-fit: cover;
            }
        }

        .right {
            display: flex;
            justify-content: end;
            align-items: center;

            .hua {
                display: inline-block;
                background: #2C68FF;
                box-shadow: 0px 2px 6px 2px rgba(44, 104, 255, 0.16);
                border-radius: 16px 0px 16px 16px;
                padding: 25px 32px;
                font-size: 16px;
                font-weight: 500;
                color: #FFFFFF;
            }

            margin-bottom: 45px;
        }

        .left {
            display: flex;
            margin-bottom: 45px;

            .tu {
                width: 48px;
                height: 48px;
                background: #A4BFF1;
                display: flex;
                align-items: center;
                justify-content: center;

                img {
                    width: 30px;
                    height: 30px;
                }

            }

            .hua {
                padding-top: 8px;

                .title {
                    font-size: 14px;
                    font-weight: 600;
                    color: rgba(0, 0, 0, 0.9);
                }

                .content {
                    width: 876px;
                    margin-top: 14px;
                    padding: 24px;
                    background: #FFFFFF;
                    box-shadow: 0px 1px 4px 0px rgba(13, 46, 166, 0.02), 0px 2px 12px 0px rgba(13, 46, 166, 0.04), 0px 2px 6px 0px rgba(13, 46, 166, 0.02);
                    border-radius: 12px;

                    .jizai {
                        font-size: 14px;
                        font-weight: 400;
                        color: rgba(0, 0, 0, 0.6);
                    }

                    .qingkuang {
                        // width: 876px;
                        background: #F5F7FB;
                        border-radius: 12px;
                        padding: 40px;
                        margin: 24px 0 30px;

                        .tou {
                            font-size: 14px;
                            font-weight: 400;
                            color: rgba(0, 0, 0, 0.6);
                        }


                        .wenzi {
                            margin-top: 10px;
                            font-size: 14px;
                            font-weight: 500;
                            color: rgba(0, 0, 0, 0.9);
                        }

                        .ksh {
                            margin: 60px 0 40px;
                            display: flex;
                            justify-content: center;

                            img {
                                height: 242px;
                                width: 330px;
                                object-fit: cover;
                            }
                        }



                    }

                    .fangan {

                        .faT {
                            font-size: 16px;
                            font-weight: 500;
                            color: rgba(0, 0, 0, 0.9);
                        }

                        .fangan1 {
                            margin-top: 16px;

                            img {

                                background: linear-gradient(180deg, #FFA400 0%, #FF6B00 100%);
                                border-radius: 12px;
                                object-fit: cover;
                            }



                            .fa {
                                cursor: pointer;
                                height: 80px;
                                background: #F8F9FA;
                                border-radius: 8px;
                                border: 1px solid rgba(151, 151, 151, 0.07);
                                box-sizing: border-box;
                                padding: 15px 28px;
                                font-size: 14px;
                                font-weight: 500;
                                color: rgba(0, 0, 0, 0.9);

                                &:hover {
                                    background: rgba(44, 104, 255, 0.09);
                                    border: 1px solid #2C68FF;
                                }

                                .con {
                                    margin-top: 8px;
                                    font-size: 14px;
                                    font-weight: 500;
                                    color: #2C68FF;

                                }
                            }

                            .active {
                                background: rgba(44, 104, 255, 0.09);
                                border: 1px solid #2C68FF;
                            }



                        }
                    }
                }
            }
        }

    }




}
</style>